public class Learn8 {
    public  static int sum(int n){
        if(n == 1){
            return 1;
        }
        return n + sum(n-1);
    }


    public static void main(String[] args) {
        int ret = sum(10);       //1 -- 10之和
        System.out.println(ret);
    }
}
